package cg.studio.practise.laddersnake;

import org.junit.Test;

public class DeliverGameTester
{
  @Test
  public void testDeliverGame()
  {
    {
      DeliverGame game = generateRadomDeliverGame( 10, 0 );
      game.play();
      System.out.println( "====================" );
    }

    {
      DeliverGame game = generateRadomDeliverGame( 10, 9 );
      game.play();
      System.out.println( "====================" );
    }

  }
  
  public DeliverGame generateRadomDeliverGame( int edgeSize, int deliverNum )
  {
    DeliverGame game = new DeliverGame( edgeSize );
    int size = game.getSize();
    for( int i=0; i<deliverNum; ++i )
    {
      int src = (int)( Math.random()*size + 1 );
      int dest = (int)( Math.random()*size + 1 );
      game.addDeliver( src, dest );
    }
    return game;
  }
}
